package cn.qzbook.controller;

import cn.qzbook.service.TestService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.HashMap;
import java.util.Map;

/**
 * @Description
 * @Author zc
 * @Date 2020/12/13 下午3:16
 */
@RestController
public class PaymentController {

    @Value("${spring.application.name}")
    private String serviceName;

    @Value("${spring.artemis.host}")
    private String hostName;

    @Value("${server.port}")
    private String port;

    @Autowired
    private TestService testService;

    @GetMapping("/host")
    public Map<String,String> getHostMes(){

        Map<String,String> map = new HashMap<>();

        map.put("server-name",serviceName);
        map.put("host-name",hostName);
        map.put("port",port);

        return map;
    }

    @GetMapping("/get")
    public String test(){
        return testService.get();
    }



}
